package models;

import play.*;
import play.db.jpa.*;

import javax.persistence.*;
import java.util.*;

@Entity
public class Post extends Model {
	
	public String title;
	
	@Lob
	public String content;
	
	public Date postDate;
	
	@ManyToOne
	public User author;
	
	@ManyToMany
	public Set<Circle> notifiedCircles;
	
	boolean toAll;

	public Post(User author, String title, String content) {
		this.author = author;
		this.title = title;
		this.content = content;
		this.postDate = new Date();
	}
	
	public Post(User author, String title, String content, boolean toAll) {
		this.author = author;
		this.title = title;
		this.content = content;
		this.postDate = new Date();
		this.toAll = toAll;
	}
	
}

